package com.song.controller;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author 宋伟宁
 * @Date 2024/1/15
 * @Version 1.0
 **/
@RestControllerAdvice
public class GlobalException {

     @ExceptionHandler(Exception.class)
     public String handleException(Exception e){
         return "{\"code:"+500+"\",\"message\":\""+e.getMessage()+"\"}";
     }
}
